/**
 * Copyright 2019 吉鼎科技.

 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.easyplatform.messages.vos.h5;

import java.io.Serializable;
import java.util.Date;

/**
 * @author <a href="mailto:davidchen@epclouds.com">littleDog</a> <br/>
 * @since 2.0.0 <br/>
 */
public class MsnVo implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private long msgid;

    private int groupId;

    private String type = MessageVo.TYPE_CHAT;

    private String fromUser;

    private String[] toUsers;

    private String text;

    private Date time;

    private int status;

    public MsnVo() {
    }

    /**
     * @param text
     */
    public MsnVo(String text) {
        this.text = text;
    }

    /**
     * @param toUsers
     * @param text
     */
    public MsnVo(String toUser, String text) {
        this.toUsers = new String[]{toUser};
        this.text = text;
    }

    /**
     * @param groupId
     * @param type
     * @param toUsers
     * @param text
     */
    public MsnVo(int groupId, String[] toUsers, String text) {
        this.groupId = groupId;
        this.toUsers = toUsers;
        this.text = text;
    }

    public void setToUser(String toUser) {
        this.toUsers = new String[]{toUser};
    }

    public String getToUser() {
        return this.toUsers == null ? null : this.toUsers[0];
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        this.groupId = groupId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String[] getToUsers() {
        return toUsers;
    }

    public String getText() {
        return text;
    }

    public String getFromUser() {
        return fromUser;
    }

    public void setFromUser(String fromUser) {
        this.fromUser = fromUser;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public long getMsgid() {
        return msgid;
    }

    public void setMsgid(long msgid) {
        this.msgid = msgid;
    }
}
